<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<title>“半价汇”广告管理系统</title>
	<!-- Reset Stylesheet -->
	<link rel="stylesheet" href="static/css/reset.css" type="text/css" media="screen" />
  
	<!-- Main Stylesheet -->
	<link rel="stylesheet" href="static/css/style.css" type="text/css" media="screen" />
	
	<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
	<link rel="stylesheet" href="static/css/invalid.css" type="text/css" media="screen" />	
	<link rel="stylesheet" type="text/css" media="screen" href="static/css//datePicker.css">

	<script type="text/javascript" src="static/js/jquery.min.js"></script>
	<!-- jQuery Configuration -->
	<script type="text/javascript" src="static/js/simpla.jquery.configuration.js"></script>

	<script type="text/javascript" src="static/js/date.js"></script>
	<script type="text/javascript" src="static/js/jquery.datePicker.js"></script>

	<script type="text/javascript" src="static/js/jquery.metadata.js"></script>
	<script type="text/javascript" src="static/js/jquery.validate.min.js"></script>
</head>
<style>
/* located in demo.css and creates a little calendar icon
 * instead of a text link for "Choose date"
 */
a.dp-choose-date {
	float: left;
	width: 16px;
	height: 16px;
	padding: 0;
	margin: 5px 3px 0;
	display: block;
	text-indent: -2000px;
	overflow: hidden;
	background: url(static/images/calendar.png) no-repeat; 
}
a.dp-choose-date.dp-disabled {
	background-position: 0 -20px;
	cursor: default;
}
/* makes the input field shorter once the date picker code
 * has run (to allow space for the calendar icon
 */
input.dp-applied {
	width: 140px;
	float: left;
}
</style>
<body>
	<div id="body-wrapper">
		<?php include 'admin_sidebar.html'; ?>
		<div id="main-content">
			<div class="content-box">
				<div class="content-box-header">
					<h3>添加广告</h3>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
				<form action="<?php echo spUrl('admin', 'post');?>" method="post" enctype="multipart/form-data" id="productadd">
				<input type="hidden" name="store_id" value="<?php echo $store_result['store_id'];?>">
				<fieldset>
						<?php if($store_result['store_id']) { ?>				
						<p>
							<label>店铺名称：</label>
							<?php echo $store_result['store_name'];?>
						</p>
						<?php } ?>
						<p>
							<label>活动名称：</label>
							<input class="text-input medium-input" type="text" id="title" name="title" value="【<?php echo $store_result['store_name']; ?>】" />
							<br /><small>不能为空</small>
						</p>
						<p>
							<label>广告图：</label>
							<input type="file" name="thumb" id="thumb" value="<?php echo $result['thumb'];?>"/>
							<br /><small>不能为空，图片大小为(310px*175px)</small>
						</p>
						<p>
							<label>分类：</label>              
							<select name="catid" validate="required:true">
								<option value="">请选择</option>
								<?php foreach($arr_cat as $k=>$v) {?>
								<option value="<?php echo $k; ?>"><?php echo $v; ?></option>
								<?php } ?>
							</select>
							<br /><small>不能为空</small>
						</p>
						<p>
							<label>开始时间：</label>
							<input class="text-input small-input required" type="text" id="startdate" name="startdate" value="<?php echo date('Y-m-d', time());?>" readonly/>
							<br /><small>不能为空</small>
						</p>
						<p>
							<label>结束时间：</label>
							<input class="text-input small-input" type="text" id="enddate" name="enddate" readonly />
							<br /><small>不能为空</small>
						</p>
						<p>
							<label>链接：</label>
							<input type="text" name="url" id="url" class="text-input medium-input" value="<?php echo $store_result['alimama_url']; ?>"/>
						</p>
						<p>
							<label>推荐位：</label>
							<!-- <input type="radio" name="posid" value="1"/>推荐到首页 <br /><input type="radio" name="posid" value="2"/>推荐到春节专题  -->
							<input type="radio" name="posid" value="4" <?php if($result['posid'] == 4){echo 'checked';} ?>/>推荐到母亲节
						</p>
						<p>
							<input type="submit" value="确定" class="button" style="width: 105px;" /> <input type="reset" style="width: 45px;" class="button">
						</p>
					</fieldset>
				</form>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
$(function() {
	Date.format = 'yyyy-mm-dd';
	$('#startdate').datePicker({startDate:'2011-01-01',clickInput:true});
	$('#enddate').datePicker({startDate:'2011-01-01',clickInput:true});
});

$.metadata.setType("attr", "validate");

$().ready(function() {
	$("#productadd").validate({
		rules:{
			title: {
				required:true,
				minlength:3
			},
			startdate: "required",
			enddate:"required",
			url:"required",
			thumb: {
				required:true,
				accept:true
			}
		}
	});
});
</script>
</html>